﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace JqueryMvcProject.App_Start.MyDefinedMvcCoreMethod
{
    /// <summary>
    /// 自定义全局错误捕捉类  一般用来做日志记录最佳选项 以及错误后跳转页面等操作  重写后在FilterConfig中设置
    /// </summary>
    public class MyGlobalExceptionAttribute:HandleErrorAttribute
    {
        public override void OnException(ExceptionContext filterContext)
        {
            if (filterContext!=null)
            {
                string GlobalExceptionMsg = filterContext.Exception.ToString();
                //Lgo.Write(GlobalExceptionMsg);
                filterContext.HttpContext.Response.Redirect("../HTMLPage.htm");
            }
        }
    }
}